function Stage(width, height, domElement){

    // TODO: run seperate thread/worker for update and draw

    function createCanvas(){
        var canvas = document.createElement("canvas");
        canvas.width  = width;
        canvas.height = height;
		canvas.attributes.tabIndex=1;
        return canvas;
    }

    this.width = width;
    this.height = height;
    this.entities = [];
    this.canvas = createCanvas();
    this.graphics = new Graphics(this.canvas);

    domElement.appendChild(this.canvas);

}

Stage.prototype.draw = function() {
    this.graphics.clear();
    this.graphics.save();
	var i = this.entities.length;
	while(i--){
		this.entities[i].draw(this.graphics);
	}
	this.graphics.restore(); 
}
Stage.prototype.filter = function(){
	this.graphics.applyFilters();
}

Stage.prototype.update = function(){
	var i =  this.entities.length;
	while(i--){
		this.entities[i].update();
	}
}

Stage.prototype.addEntity = function(entity) {
    this.entities.push(entity);
}